<?php

/**
 *
 */
Class Module_CallCenter_Main
{
    public static function request($param){

        if(!Lib_Notice::checkData($param,['pass','execute'])){
            return Lib_Notice::response(4103,"缺少必要参数，请联系开发人员");
        }

        $pass = $param['pass'];
        $execute = $param['execute'];
        $method = '';
        switch ($pass)
        {
            case "ZhonTou":
                $class = 'Module_CallCenter_ZhonTou_Call';
                $request = $param;
                break;
            case "YiChao":
                $class = 'Module_CallCenter_YiChao_Call';
                $request = $param;
                break;
            case "YunKeFu":
                $class = 'Module_CallCenter_YunKeFu_Call';
                $request = $param;
                break;
            default:
                return ['code'=>4000,'message'=>'不合法的呼叫通道'];

        }
        $method = empty($method) ? $execute : $method;

        if($pass == 'YunKeFu'){
            $line = $param['workerId'] > 7000 ? 1 : 2;
            return $class::getInstance($line)->$method($request);
        }
        return $class::getInstance()->$method($request);
    }

}